<template>
  <div>
      <el-dialog
        title="批量填报"
        :visible.sync="tbDialog.dialogVisible"
        width="30%"
        center>
        <el-row>
          <el-col v-if="tbDialog.zhiShow=='1'" :span="24">
              <el-input v-model="completion" placeholder="完成情况"></el-input>
          </el-col>
          <el-col :span="24">
              <el-input v-if="tbDialog.zhiShow=='2'" style="margin-bottom:20px;" oninput ="value=value.replace(/[^0-9.]/g,'')" v-model="tbSz" placeholder="填报值"></el-input>
              <el-input v-if="tbDialog.zhiShow=='3'||tbDialog.zhiShow=='4'||tbDialog.zhiShow=='5'" oninput ="value=value.replace(/[^0-9.]/g,'')" style="margin-bottom:20px;"  v-model="zbDf" placeholder="得分"></el-input>
              <el-input v-if="tbDialog.zhiShow=='4'||tbDialog.zhiShow=='5'||tbDialog.zhiShow=='6'||tbDialog.zhiShow=='7'" oninput ="value=value.replace(/[^0-9.]/g,'')" v-model="rewaPuni" placeholder="其他奖惩"></el-input>
          </el-col>
        </el-row>
        <span slot="footer" class="dialog-footer">
            <el-button  @click="tianbaoBatch">确定</el-button>
            <el-button type="primary" @click="tbDialog.dialogVisible = false">关闭</el-button>
        </span>
     </el-dialog>
  </div>
</template>

<script>
import {tianbaoBatch,shenheBatch,hzBatch} from '@/api/hetongrenwu/gongzuorenwushu/workAssignjgtb'
export default {
    name:"tianbao-dialog",
    props:{
        tbDialog:{}
    },
    data(){
        return{
            zhiShow:0,
            completion:"",
            tbSz:0,
            zbDf:0,
            rewaPuni:0
        }
    },
    created(){

    },
    methods:{
      tianbaoBatch(){
          if(this.tbDialog.zhiShow=='3'){
              var params={
                ids:this.tbDialog.idsStr,
                zbDf:this.zbDf
              }
              shenheBatch(params).then(response => {
              this.tbDialog.dialogVisible = false;
              this.$emit('closeDialog')
            })
          }else if(this.tbDialog.zhiShow=='4'||this.tbDialog.zhiShow=='5'){
              var params={
                ids:this.tbDialog.idsStr,
                zbDf:this.zbDf,
                rewaPuni:this.rewaPuni
              }
              hzBatch(params).then(response => {
                this.tbDialog.dialogVisible = false;
                this.$emit('closeDialog')
              })
          }else if(this.tbDialog.zhiShow=='6'||this.tbDialog.zhiShow=='7'){
            var params={
              ids:this.tbDialog.idsStr,
              rewaPuni:this.rewaPuni
            }
            hzBatch(params).then(response => {
              this.tbDialog.dialogVisible = false;
              this.$emit('closeDialog')
            })
          }else{
            var params={
              ids:this.tbDialog.idsStr,
              tbSz:this.tbSz,
              compleStatus:this.completion
            }
           //console.log(params);
            tianbaoBatch(params).then(response => {
              this.tbDialog.dialogVisible = false;
              this.$emit('closeDialog')
            })
          }
      },
    }

}
</script>

<style>

</style>
